package com.linwen.excise.od;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @ClassName _素数的积
 * @Description TODO
 * @Author zero
 * @DATE 2024/4/10 9:34 PM
 * @Version 1.0
 */
public class _素数的积 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        ArrayList<Integer> integers = new ArrayList<Integer>();
        for (int i = 2; i < 10000; i++) {
            if(isSushu(i)){
                integers.add(i);
            }
        }
        for (int i = 0; i < integers.size(); i++) {
            for (int j = 0; j < integers.size(); j++) {
                if(integers.get(i)*integers.get(j)==n){
                    System.out.println(integers.get(i)+" "+integers.get(j));
                    return;
                }
            }
        }
        System.out.println(-1+" "+-1);
    }
    private static boolean isSushu(int n) {
        if(n<=2){
            return true;
        }
        if(n%2==1){
            return false;
        }
        for (int i = 2; i < n/2; i++) {
            for (int j = 2; j < n/2; j++) {
                if(i*j==n){
                    return false;
                }
            }
        }
        return true;
    }
}
